package com.heima.wemedia.controller.v1;

import com.heima.model.article.dtos.SensitivePageDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.enums.AppHttpCodeEnum;
import com.heima.model.wemedia.dtos.AdSensitive;
import com.heima.model.wemedia.pojos.WmSensitive;
import com.heima.wemedia.service.SensitiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/api/v1/sensitive")
@RestController
public class SensitiveController {
    @Autowired
    private SensitiveService sensitiveService;
    @PostMapping("/list")
    public ResponseResult findAll(@RequestBody SensitivePageDto dto){
        return sensitiveService.findAll(dto);
    }

    @PostMapping("/save")
    public ResponseResult newIncreased(@RequestBody AdSensitive adSensitive){
        return sensitiveService.newIncreased(adSensitive);
    }
    @PostMapping("/update")
    public ResponseResult updateSensitive(@RequestBody AdSensitive adSensitive){
       return ResponseResult.okResult(AppHttpCodeEnum.SUCCESS);
    }

    @PostMapping("del/{id}")
    public ResponseResult delSensitive(@RequestBody Integer id){
        return ResponseResult.okResult(AppHttpCodeEnum.SUCCESS);
    }
}
